<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script type="text/javascript">
	function getSysMsg() {
		$.ajax({
			cache	: true,
			type	: "POST",
			url		: "GetSysMsg",
			data	: "",
			async	: false,
			error	: function(request) {
				//layer.msg("抱歉,由于网络故障访问失败.", {icon: 5});
			},
			success : function(data) {
				if(data != "") {
					var obj = JSON.parse(data);
					var txt = "<div style='width:200px;padding: 20px 20px 20px 30px;'>";
					txt += "<span style='color:#008B8B;'><a href='GetSysMessage'>您有" + obj.length + "条新订单待处理.</a></span></div>";
					layer.open({
						type	: 1,
						offset	: 'rb',
						id		: 'layerSysMsg',
						title	: '新订单提醒',
						content	: txt,
						btnAlign: 'c',
						shade	: 0,
						skin	: 'layui-layer-molv',
						yes		: function() {
							layer.closeAll();
						}
					});
				}
			}
		});
	}
	var timer = setInterval("getSysMsg()", 5000);
</script>